home *** CD-ROM | disk | FTP | other *** search
/ PC User 2003 September / Australian PC User - September 2003 (CD1).iso / magstuff / web / files / dwmx61.exe / Disk1 / data1.cab / Configuration_En / Menus / MM / ToggleBreakpoint.js < prev    next >
Encoding:
JavaScript  |  2002-11-25  |  836 b   |  33 lines

  1. // Copyright 2000 Macromedia, Inc. All rights reserved.
  2.  
  3. function toggleBreakpoint()
  4. {
  5.    var doc = dw.getDocumentDOM('document');
  6.    if (doc)
  7.    {
  8.       var line = doc.getLineFromOffset(doc.source.getSelection()[0]);
  9.       doc.setBreakpoint(line, !doc.getBreakpoint(line));
  10.    }
  11. }
  12.  
  13. function canAcceptCommand()
  14. {
  15.    return dw.getFocus() == 'textView' ||
  16.             (dw.getFocus() == 'none' && dw.getDocumentDOM() != null && dw.getDocumentDOM('document').getFocus() != 'frameset');
  17. }
  18.  
  19. function setMenuText()
  20. {
  21.    var doc = dw.getDocumentDOM('document');
  22.    if (doc)
  23.    {
  24.       var line = doc.getLineFromOffset(doc.source.getSelection()[0]);
  25.       if ( !doc.getBreakpoint(line) )
  26.          return MENU_SetBreakpoint;
  27.       else
  28.          return MENU_RemoveBreakpoint;
  29.    }
  30.    else
  31.       return MENU_SetBreakpoint;
  32. }
  33.